
#include "bridge.h"


const char*	PortTimers_802_1Q_2005_GetStateName (SM_STATE state);
SM_STATE	PortTimers_802_1Q_2005_CheckConditions	(BRIDGE* bridge, int givenPort, int givenTree, SM_STATE state);
void		PortTimers_802_1Q_2005_InitState		(BRIDGE* bridge, int givenPort, int givenTree, SM_STATE state);

const char*	PortProtocolMigration_802_1Q_2005_GetStateName (SM_STATE state);
SM_STATE	PortProtocolMigration_802_1Q_2005_CheckConditions	(BRIDGE* bridge, int givenPort, int givenTree, SM_STATE state);
void		PortProtocolMigration_802_1Q_2005_InitState			(BRIDGE* bridge, int givenPort, int givenTree, SM_STATE state);

const char*	PortReceive_802_1Q_2005_GetStateName (SM_STATE state);
SM_STATE	PortReceive_802_1Q_2005_CheckConditions	(BRIDGE* bridge, int givenPort, int givenTree, SM_STATE state);
void		PortReceive_802_1Q_2005_InitState		(BRIDGE* bridge, int givenPort, int givenTree, SM_STATE state);

const char*	BridgeDetection_802_1Q_2005_GetStateName (SM_STATE state);
SM_STATE	BridgeDetection_802_1Q_2005_CheckConditions	(BRIDGE* bridge, int givenPort, int givenTree, SM_STATE state);
void		BridgeDetection_802_1Q_2005_InitState		(BRIDGE* bridge, int givenPort, int givenTree, SM_STATE state);

const char*	PortInformation_802_1Q_2005_GetStateName (SM_STATE state);
SM_STATE	PortInformation_802_1Q_2005_CheckConditions	(BRIDGE* bridge, int givenPort, int givenTree, SM_STATE state);
void		PortInformation_802_1Q_2005_InitState		(BRIDGE* bridge, int givenPort, int givenTree, SM_STATE state);

const char*	PortRoleSelection_802_1Q_2005_GetStateName (SM_STATE state);
SM_STATE	PortRoleSelection_802_1Q_2005_CheckConditions	(BRIDGE* bridge, int givenPort, int givenTree, SM_STATE state);
void		PortRoleSelection_802_1Q_2005_InitState			(BRIDGE* bridge, int givenPort, int givenTree, SM_STATE state);

const char*	PortRoleTransitions_802_1Q_2005_GetStateName (SM_STATE state);
SM_STATE	PortRoleTransitions_802_1Q_2005_CheckConditions	(BRIDGE* bridge, int givenPort, int givenTree, SM_STATE state);
void		PortRoleTransitions_802_1Q_2005_InitState		(BRIDGE* bridge, int givenPort, int givenTree, SM_STATE state);

const char*	PortStateTransition_802_1Q_2005_GetStateName (SM_STATE state);
SM_STATE	PortStateTransition_802_1Q_2005_CheckConditions	(BRIDGE* bridge, int givenPort, int givenTree, SM_STATE state);
void		PortStateTransition_802_1Q_2005_InitState		(BRIDGE* bridge, int givenPort, int givenTree, SM_STATE state);

const char*	PortTransmit_802_1Q_2005_GetStateName (SM_STATE state);
SM_STATE	PortTransmit_802_1Q_2005_CheckConditions	(BRIDGE* bridge, int givenPort, int givenTree, SM_STATE state);
void		PortTransmit_802_1Q_2005_InitState			(BRIDGE* bridge, int givenPort, int givenTree, SM_STATE state);

const char*	TopologyChange_802_1Q_2005_GetStateName (SM_STATE state);
SM_STATE	TopologyChange_802_1Q_2005_CheckConditions	(BRIDGE* bridge, int givenPort, int givenTree, SM_STATE state);
void		TopologyChange_802_1Q_2005_InitState		(BRIDGE* bridge, int givenPort, int givenTree, SM_STATE state);


static const SM_INFO smInfo [] =
{
	{
		SM_INFO::PER_PORT,
		"PortTimers",
		PortTimers_802_1Q_2005_GetStateName,
		PortTimers_802_1Q_2005_CheckConditions,
		PortTimers_802_1Q_2005_InitState
	},

	{
		SM_INFO::PER_PORT,
		"PortProtocolMigration",
		PortProtocolMigration_802_1Q_2005_GetStateName,
		PortProtocolMigration_802_1Q_2005_CheckConditions,
		PortProtocolMigration_802_1Q_2005_InitState
	},

	{
		SM_INFO::PER_PORT,
		"PortReceive",
		PortReceive_802_1Q_2005_GetStateName,
		PortReceive_802_1Q_2005_CheckConditions,
		PortReceive_802_1Q_2005_InitState
	},

	{
		SM_INFO::PER_PORT,
		"BridgeDetection",
		BridgeDetection_802_1Q_2005_GetStateName,
		BridgeDetection_802_1Q_2005_CheckConditions,
		BridgeDetection_802_1Q_2005_InitState
	},

	{
		SM_INFO::PER_PORT_PER_TREE,
		"PortInformation",
		PortInformation_802_1Q_2005_GetStateName,
		PortInformation_802_1Q_2005_CheckConditions,
		PortInformation_802_1Q_2005_InitState
	},

	{
		SM_INFO::PER_BRIDGE_PER_TREE,
		"PortRoleSelection",
		PortRoleSelection_802_1Q_2005_GetStateName,
		PortRoleSelection_802_1Q_2005_CheckConditions,
		PortRoleSelection_802_1Q_2005_InitState
	},

	{
		SM_INFO::PER_PORT_PER_TREE,
		"PortRoleTransitions",
		PortRoleTransitions_802_1Q_2005_GetStateName,
		PortRoleTransitions_802_1Q_2005_CheckConditions,
		PortRoleTransitions_802_1Q_2005_InitState
	},

	{
		SM_INFO::PER_PORT_PER_TREE,
		"PortStateTransition",
		PortStateTransition_802_1Q_2005_GetStateName,
		PortStateTransition_802_1Q_2005_CheckConditions,
		PortStateTransition_802_1Q_2005_InitState
	},

	{
		SM_INFO::PER_PORT_PER_TREE,
		"TopologyChange",
		TopologyChange_802_1Q_2005_GetStateName,
		TopologyChange_802_1Q_2005_CheckConditions,
		TopologyChange_802_1Q_2005_InitState
	},
};

static const SM_INFO transmitSmInfo =
{	
	SM_INFO::PER_PORT,
	"PortTransmit",
	PortTransmit_802_1Q_2005_GetStateName,
	PortTransmit_802_1Q_2005_CheckConditions,
	PortTransmit_802_1Q_2005_InitState
};

const SM_INTERFACE smInterface_802_1Q_2005 =
{
	smInfo,
	sizeof (smInfo) / sizeof (SM_INFO),
	&transmitSmInfo
};


/*
const SM_INTERFACE smInterface_802_1Q_2005 =
{
	NULL, // smInfo,
	0, // sizeof (smInfo) / sizeof (SM_INFO),
	NULL, // &transmitSmInfo
};
*/
